package homeWork;

import java.beans.MethodDescriptor;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Scanner;
import test.Stack02;

public class test {
    public static void main(String[] args) throws Exception{
        //io
        //获取流
        FileInputStream fis = new FileInputStream("C:\\Users\\织\\Desktop\\捕获3.JPG");
        FileOutputStream fos = new FileOutputStream("C:\\Users\\织\\Desktop\\复制捕获3.JPG");
        byte[]test =new byte[1024];
        int length =0;

            while((length = fis.read(test))!=-1){
                String string=new String(test,0,length);
                System.out.println(string);
                fos.write(test);

            }
            //刷新和关闭
            fos.flush();
            fis.close();
            fos.close();

        //反射
        /*Stack02 stack02 = new Stack02(50);
        Class lass=stack02.getClass();
        //获取属性
        Field fi = lass.getDeclaredField("max");
        //访问权限修改-----原来只能查public
        fi.setAccessible(true);
        System.out.println(fi.get(stack02));
        fi.set(stack02,20);
        System.out.println(fi.get(stack02));
        //获取方法
        Method me  =lass.getDeclaredMethod("push","1".getClass());
        //调用
        me.invoke(stack02,"123");
        //调用带参构造拿到对象
        Constructor con=lass.getDeclaredConstructor(int.class);
        Object o = con.newInstance(10);
*/
        b b1=new b();
        b1.start();

    }
}

class b extends Thread{
    @Override
    public void run(){
        System.out.println("线程");
    }


}